<?php

namespace App\Policies;

use App\Models\User;
use Illuminate\Auth\Access\HandlesAuthorization;

class UserPolicy
{
    use HandlesAuthorization;

    /**
     * Create a new policy instance.
     *
     * @return void
     */
  //user model-> UsersController-> update方法
   public function update(User $currentUser, User $user)
   {
      return  $currentUser->id === $user->id;

   }



}
